package m4d2;

import java.util.function.Predicate;

//函数式接口    抽象方法对传入的内容进行判断进行判断
public class hPredicate {
    public static boolean checkString(String str, Predicate<String> pre){
        return pre.test(str);
    }

    public static void main(String[] args) {
        String str = "aaaa";

        boolean b = checkString(str,(String s)->{
            //对长度进行判断大于5
            return str.length()>5;
        });
        System.out.println(b);
    }
}
